package com.ccnf.service;

import com.baomidou.mybatisplus.service.IService;
import com.ccnf.model.entity.InvitationAuth;
import com.ccnf.model.entity.InvitationAuth;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author developer
 * @since 2018-08-03
 */
public interface InvitationAuthService extends IService<InvitationAuth> {

    /**
     * 录入邀请函授权用户信息
     * @param invitationAuth
     * @return 返回授权ID
     */
    Long saveInvitationAuth(InvitationAuth invitationAuth);

    /**
     * 修改邀请函授权人信息
     * @param invitationAuth
     */
    void modifyInvitationAuth(InvitationAuth invitationAuth);

    /**
     * 查询邀请函授权用户列表
     * @param invitationId 邀请函ID
     */
    List<Map<String, Object>> findInvitationAuthUsersByInvitationId(Long invitationId);

    /**
     * 删除邀请函授权用户
     * @param invitationId 邀请函ID
     * @param userId 用户ID
     * @param authIds 需要删除的授权ID数组
     */
    void removeAuthUsers(Long invitationId, Long userId, Long[] authIds);

    /**
     * 通过邀请函ID和用户ID查询邀请函授权信息
     * @param invitationId 邀请函ID
     * @param userId 用户ID
     * @return 邀请函授权信息
     */
    InvitationAuth findInvitationAuthByInvitationIdAndUserId(Long invitationId, Long userId);
}